﻿#ifndef LOGSERVERCONFIG_H
#define LOGSERVERCONFIG_H

#include "configManager/configobject.h"

class LogServerConfig : public ConfigObject
{
    Q_OBJECT

    Q_PROPERTY(bool showWindow READ showWindow WRITE setShowWindow NOTIFY showWindowChanged)
    Q_PROPERTY(
        bool outputLogToConsole READ outputLogToConsole WRITE setOutputLogToConsole NOTIFY outputLogToConsoleChanged)

public:
    LogServerConfig(QObject *parent = nullptr) : ConfigObject(parent)
    {
        init();
    }

    bool showWindow() const
    {
        return m_showWindow;
    }

    bool outputLogToConsole() const
    {
        return m_outputLogToConsole;
    }

public slots:
    void setShowWindow(bool showWindow)
    {
        if (m_showWindow == showWindow)
            return;

        m_showWindow = showWindow;
        emit showWindowChanged(m_showWindow);
    }

    void setOutputLogToConsole(bool outputLogToConsole)
    {
        if (m_outputLogToConsole == outputLogToConsole)
            return;

        m_outputLogToConsole = outputLogToConsole;
        emit outputLogToConsoleChanged(m_outputLogToConsole);
    }

signals:
    void showWindowChanged(bool showWindow);

    void outputLogToConsoleChanged(bool outputLogToConsole);

private:
    bool m_showWindow = false;
    bool m_outputLogToConsole = false;
};

#endif    // LOGSERVERCONFIG_H
